import { CHANGE_CATEGORY_SWIPE, CHANGE_SELECTED_ITEM, CHANGE_CATEGORY_DATE_LIST } from './categoryActiveTypes';

let defaultState = {
    categorySwipeList: [],
    SelectedItem: '',//选择的食品类型
    categoryDateList: []//分类页面的用户数据
}
export default (state = defaultState, action) => {
    console.log(111, action);
    if (action.type === CHANGE_CATEGORY_SWIPE) {
        let initState = JSON.parse(JSON.stringify(state));
        initState.categorySwipeList = action.value;
        return initState;
    }
    if (action.type === CHANGE_SELECTED_ITEM) {
        let initState = JSON.parse(JSON.stringify(state));
        initState.SelectedItem = action.value;
        return initState;
    }
    if (action.type === CHANGE_CATEGORY_DATE_LIST) {
        let initState = JSON.parse(JSON.stringify(state));
        initState.categoryDateList = action.value;
        return initState;
    }
    return state;
}